package com.pm2.dao.project;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.pm2.entity.weekMeet.TaskAttachment;

public interface TaskAttachmentDao extends JpaRepository<TaskAttachment, Integer> {
	
	public List<TaskAttachment> findByTaskId(Integer id);
	
	 @Query(value = "select f.*,u.actual_name from db_pm2_task_attachmen f "
	 		+ "LEFT JOIN db_system_user_user u on f.upload_user = u.id "
	 		+ "where f.task_id=:taskId",nativeQuery = true)
	 public  List<Object[]> findFileByTaskId(@Param("taskId") Integer taskId);

}
